package cn.sunline.dreamvalue.controller;

import cn.sunline.dreamvalue.constant.CommonResult;
import cn.sunline.dreamvalue.dto.DreamAcctOpenDTO;
import cn.sunline.dreamvalue.dto.DreamValueTaskOutDTO;
import cn.sunline.dreamvalue.service.DreamValueService;
import cn.sunline.dreamvalue.service.HbaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @title: DreamTaskController
 * @projectName dream-value
 * @description: 查询客户完成度
 * @author 82345
 * @date 2020/5/14 12:10
 */
@RestController
public class DreamTaskController {

    @Autowired
    private DreamValueService dreamValueService;

    @Autowired
    private HbaseService hbaseService;

    /**
     　* @description: 查询客户完成进度
     　* @param [input]
     　* @return cn.sunline.dreamvalue.constant.CommonResult<cn.sunline.dreamvalue.dto.DreamValueTaskOutDTO>
     　* @author 82345
     　* @date 2020/5/14 12:11
     */
    @PostMapping("/dreamTask/customerProgressQuery")
    public CommonResult<DreamValueTaskOutDTO> querySchedule(@RequestBody DreamAcctOpenDTO input) throws Exception {

        try{
            return dreamValueService.querySchedule(input);
        }catch (Exception e){
            e.printStackTrace();
            return CommonResult.failed();
        }
    }
}
